<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 实现点击按钮切换图片 -->

    <script src="./vue.js"></script>
    <div class="app">
        <img :src="imgsrc" alt="">
        <button @click="check">点一下切换图片</button>
    </div>
    

</body>

<script>
 new Vue({
    el:".app",
    data:{
        imgsrc:"./image/img1.jpg"
    },
    methods: {
        check(){
            // 
            if(this.imgsrc=="./image/img1.jpg"){
                this.imgsrc="./image/img2.jpg"
            }else{
                this.imgsrc="./image/img1.jpg"
            }
             console.log(this.imgsrc)
        }
       
    },
})
</script>
</html>